package com.huawei.appgallery.forum.base.card;

import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import android.widget.Toast;
import o.bqz.d;
import o.bsp;
import o.cgz;
import o.cii;
import o.dof;

public abstract class ForumCard extends cgz {
    public ForumCard(Context context) {
        super(context);
    }

    protected void ˊ(TextView textView, String str) {
        if (textView != null) {
            textView.setText(str);
        }
    }

    protected boolean ˊ() {
        return bsp.ˋ();
    }

    public OnClickListener ˋ() {
        return new OnClickListener(this) {
            final /* synthetic */ ForumCard ˊ;

            {
                this.ˊ = r1;
            }

            public void onClick(View view) {
                Object tag = view.getTag();
                if (tag instanceof ForumCardBean) {
                    ForumCardBean forumCardBean = (ForumCardBean) tag;
                    if (!dof.ॱ(forumCardBean.ॱॱ())) {
                        Context context = view.getContext();
                        if (context != null && !cii.ˊ().ˊ(context, forumCardBean)) {
                            Toast.makeText(context, d.ˉ, 0).show();
                        }
                    }
                }
            }
        };
    }
}
